<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 1988-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Vectors (GNU Compiler Collection (GCC) Internals)</title>

<meta name="description" content="Vectors (GNU Compiler Collection (GCC) Internals)">
<meta name="keywords" content="Vectors (GNU Compiler Collection (GCC) Internals)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Option-Index.html" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Expression-trees.html" rel="up" title="Expression trees">
<link href="Unary-and-Binary-Expressions.html" rel="prev" title="Unary and Binary Expressions">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="subsection-level-extent" id="Vectors">
<div class="nav-panel">
<p>
Previous: <a href="Unary-and-Binary-Expressions.html" accesskey="p" rel="prev">Unary and Binary Expressions</a>, Up: <a href="Expression-trees.html" accesskey="u" rel="up">Expressions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="Vectors-1"><span>11.6.4 Vectors<a class="copiable-link" href="#Vectors-1"> &para;</a></span></h4>
<a class="index-entry-id" id="index-VEC_005fDUPLICATE_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fSERIES_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fLSHIFT_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fRSHIFT_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fWIDEN_005fMULT_005fHI_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fWIDEN_005fMULT_005fLO_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fWIDEN_005fPLUS_005fHI_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fWIDEN_005fPLUS_005fLO_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fWIDEN_005fMINUS_005fHI_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fWIDEN_005fMINUS_005fLO_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fUNPACK_005fHI_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fUNPACK_005fLO_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fUNPACK_005fFLOAT_005fHI_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fUNPACK_005fFLOAT_005fLO_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fUNPACK_005fFIX_005fTRUNC_005fHI_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fUNPACK_005fFIX_005fTRUNC_005fLO_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fPACK_005fTRUNC_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fPACK_005fSAT_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fPACK_005fFIX_005fTRUNC_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fPACK_005fFLOAT_005fEXPR"></a>
<a class="index-entry-id" id="index-VEC_005fCOND_005fEXPR"></a>
<a class="index-entry-id" id="index-SAD_005fEXPR"></a>

<dl class="table">
<dt><code class="code">VEC_DUPLICATE_EXPR</code></dt>
<dd><p>This node has a single operand and represents a vector in which every
element is equal to that operand.
</p>
</dd>
<dt><code class="code">VEC_SERIES_EXPR</code></dt>
<dd><p>This node represents a vector formed from a scalar base and step,
given as the first and second operands respectively.  Element <var class="var">i</var>
of the result is equal to &lsquo;<samp class="samp"><var class="var">base</var> + <var class="var">i</var>*<var class="var">step</var></samp>&rsquo;.
</p>
<p>This node is restricted to integral types, in order to avoid
specifying the rounding behavior for floating-point types.
</p>
</dd>
<dt><code class="code">VEC_LSHIFT_EXPR</code></dt>
<dt><code class="code">VEC_RSHIFT_EXPR</code></dt>
<dd><p>These nodes represent whole vector left and right shifts, respectively.
The first operand is the vector to shift; it will always be of vector type.
The second operand is an expression for the number of bits by which to
shift.  Note that the result is undefined if the second operand is larger
than or equal to the first operand&rsquo;s type size.
</p>
</dd>
<dt><code class="code">VEC_WIDEN_MULT_HI_EXPR</code></dt>
<dt><code class="code">VEC_WIDEN_MULT_LO_EXPR</code></dt>
<dd><p>These nodes represent widening vector multiplication of the high and low
parts of the two input vectors, respectively.  Their operands are vectors
that contain the same number of elements (<code class="code">N</code>) of the same integral type.
The result is a vector that contains half as many elements, of an integral type
whose size is twice as wide.  In the case of <code class="code">VEC_WIDEN_MULT_HI_EXPR</code> the
high <code class="code">N/2</code> elements of the two vector are multiplied to produce the
vector of <code class="code">N/2</code> products. In the case of <code class="code">VEC_WIDEN_MULT_LO_EXPR</code> the
low <code class="code">N/2</code> elements of the two vector are multiplied to produce the
vector of <code class="code">N/2</code> products.
</p>
</dd>
<dt><code class="code">VEC_WIDEN_PLUS_HI_EXPR</code></dt>
<dt><code class="code">VEC_WIDEN_PLUS_LO_EXPR</code></dt>
<dd><p>These nodes represent widening vector addition of the high and low parts of
the two input vectors, respectively.  Their operands are vectors that contain
the same number of elements (<code class="code">N</code>) of the same integral type. The result
is a vector that contains half as many elements, of an integral type whose size
is twice as wide.  In the case of <code class="code">VEC_WIDEN_PLUS_HI_EXPR</code> the high
<code class="code">N/2</code> elements of the two vectors are added to produce the vector of
<code class="code">N/2</code> products.  In the case of <code class="code">VEC_WIDEN_PLUS_LO_EXPR</code> the low
<code class="code">N/2</code> elements of the two vectors are added to produce the vector of
<code class="code">N/2</code> products.
</p>
</dd>
<dt><code class="code">VEC_WIDEN_MINUS_HI_EXPR</code></dt>
<dt><code class="code">VEC_WIDEN_MINUS_LO_EXPR</code></dt>
<dd><p>These nodes represent widening vector subtraction of the high and low parts of
the two input vectors, respectively.  Their operands are vectors that contain
the same number of elements (<code class="code">N</code>) of the same integral type. The high/low
elements of the second vector are subtracted from the high/low elements of the
first. The result is a vector that contains half as many elements, of an
integral type whose size is twice as wide.  In the case of
<code class="code">VEC_WIDEN_MINUS_HI_EXPR</code> the high <code class="code">N/2</code> elements of the second
vector are subtracted from the high <code class="code">N/2</code> of the first to produce the
vector of <code class="code">N/2</code> products.  In the case of
<code class="code">VEC_WIDEN_MINUS_LO_EXPR</code> the low <code class="code">N/2</code> elements of the second
vector are subtracted from the low <code class="code">N/2</code> of the first to produce the
vector of <code class="code">N/2</code> products.
</p>
</dd>
<dt><code class="code">VEC_UNPACK_HI_EXPR</code></dt>
<dt><code class="code">VEC_UNPACK_LO_EXPR</code></dt>
<dd><p>These nodes represent unpacking of the high and low parts of the input vector,
respectively.  The single operand is a vector that contains <code class="code">N</code> elements
of the same integral or floating point type.  The result is a vector
that contains half as many elements, of an integral or floating point type
whose size is twice as wide.  In the case of <code class="code">VEC_UNPACK_HI_EXPR</code> the
high <code class="code">N/2</code> elements of the vector are extracted and widened (promoted).
In the case of <code class="code">VEC_UNPACK_LO_EXPR</code> the low <code class="code">N/2</code> elements of the
vector are extracted and widened (promoted).
</p>
</dd>
<dt><code class="code">VEC_UNPACK_FLOAT_HI_EXPR</code></dt>
<dt><code class="code">VEC_UNPACK_FLOAT_LO_EXPR</code></dt>
<dd><p>These nodes represent unpacking of the high and low parts of the input vector,
where the values are converted from fixed point to floating point.  The
single operand is a vector that contains <code class="code">N</code> elements of the same
integral type.  The result is a vector that contains half as many elements
of a floating point type whose size is twice as wide.  In the case of
<code class="code">VEC_UNPACK_FLOAT_HI_EXPR</code> the high <code class="code">N/2</code> elements of the vector are
extracted, converted and widened.  In the case of <code class="code">VEC_UNPACK_FLOAT_LO_EXPR</code>
the low <code class="code">N/2</code> elements of the vector are extracted, converted and widened.
</p>
</dd>
<dt><code class="code">VEC_UNPACK_FIX_TRUNC_HI_EXPR</code></dt>
<dt><code class="code">VEC_UNPACK_FIX_TRUNC_LO_EXPR</code></dt>
<dd><p>These nodes represent unpacking of the high and low parts of the input vector,
where the values are truncated from floating point to fixed point.  The
single operand is a vector that contains <code class="code">N</code> elements of the same
floating point type.  The result is a vector that contains half as many
elements of an integral type whose size is twice as wide.  In the case of
<code class="code">VEC_UNPACK_FIX_TRUNC_HI_EXPR</code> the high <code class="code">N/2</code> elements of the
vector are extracted and converted with truncation.  In the case of
<code class="code">VEC_UNPACK_FIX_TRUNC_LO_EXPR</code> the low <code class="code">N/2</code> elements of the
vector are extracted and converted with truncation.
</p>
</dd>
<dt><code class="code">VEC_PACK_TRUNC_EXPR</code></dt>
<dd><p>This node represents packing of truncated elements of the two input vectors
into the output vector.  Input operands are vectors that contain the same
number of elements of the same integral or floating point type.  The result
is a vector that contains twice as many elements of an integral or floating
point type whose size is half as wide. The elements of the two vectors are
demoted and merged (concatenated) to form the output vector.
</p>
</dd>
<dt><code class="code">VEC_PACK_SAT_EXPR</code></dt>
<dd><p>This node represents packing of elements of the two input vectors into the
output vector using saturation.  Input operands are vectors that contain
the same number of elements of the same integral type.  The result is a
vector that contains twice as many elements of an integral type whose size
is half as wide.  The elements of the two vectors are demoted and merged
(concatenated) to form the output vector.
</p>
</dd>
<dt><code class="code">VEC_PACK_FIX_TRUNC_EXPR</code></dt>
<dd><p>This node represents packing of elements of the two input vectors into the
output vector, where the values are converted from floating point
to fixed point.  Input operands are vectors that contain the same number
of elements of a floating point type.  The result is a vector that contains
twice as many elements of an integral type whose size is half as wide.  The
elements of the two vectors are merged (concatenated) to form the output
vector.
</p>
</dd>
<dt><code class="code">VEC_PACK_FLOAT_EXPR</code></dt>
<dd><p>This node represents packing of elements of the two input vectors into the
output vector, where the values are converted from fixed point to floating
point.  Input operands are vectors that contain the same number of elements
of an integral type.  The result is a vector that contains twice as many
elements of floating point type whose size is half as wide.  The elements of
the two vectors are merged (concatenated) to form the output vector.
</p>
</dd>
<dt><code class="code">VEC_COND_EXPR</code></dt>
<dd><p>These nodes represent <code class="code">?:</code> expressions.  The three operands must be
vectors of the same size and number of elements.  The second and third
operands must have the same type as the entire expression.  The first
operand is of signed integral vector type.  If an element of the first
operand evaluates to a zero value, the corresponding element of the
result is taken from the third operand. If it evaluates to a minus one
value, it is taken from the second operand. It should never evaluate to
any other value currently, but optimizations should not rely on that
property. In contrast with a <code class="code">COND_EXPR</code>, all operands are always
evaluated.
</p>
</dd>
<dt><code class="code">SAD_EXPR</code></dt>
<dd><p>This node represents the Sum of Absolute Differences operation.  The three
operands must be vectors of integral types.  The first and second operand
must have the same type.  The size of the vector element of the third
operand must be at lease twice of the size of the vector element of the
first and second one.  The SAD is calculated between the first and second
operands, added to the third operand, and returned.
</p>
</dd>
</dl>



</div>
<hr>
<div class="nav-panel">
<p>
Previous: <a href="Unary-and-Binary-Expressions.html">Unary and Binary Expressions</a>, Up: <a href="Expression-trees.html">Expressions</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
